home *** CD-ROM | disk | FTP | other *** search
- COOL CALCULATOR 1.0
- ===================
-
- The Cool Calculator 1.0 program is a product from the Pie Right
- software family offered by abc Systems of Bridgeport, CT. It is
- a simple business calculator in which you can either type your
- expressions (including use of parentheses) are build them by
- clicking on a collection of buttons (1,2,3,4,5,6,7,8,9,0,(,),*,
- +,-,/,=). Pysically it is a simple interface (Delphi Form) to
- an expression evaluation engine originally written by James L.
- Dean in 1985, and overhauled and enhanced by David J. Firth in
- 1991. "I'll be back" with a component version of this calculator
- sometime in the upcoming weeks.
-
- I have not surfaced all the functionality of David's program, but
- it is not difficult to do so, if you are so inclined. Things left
- unsurfaced are: ABS, ARCTAN, COS, EXP, LN, SQR, SQRT, and PI
- functions, along with the ability to use variables.
-
- The code for David J. Wirth's version of the evaluation engine and
- his additional RPN evaluation engine can be found on the Delphi
- forum on CompuServe in the file called EEV10.ZIP. In extending the
- Cool Calculator are using the calculation engine in your programs
- you will want to download that file. I have included some of
- David's information about his program below.
-
- NOTE: Be advised we created Cool Calculator 1.0 just for kicks and
- did it in under 2 hours, and because we had no real application in
- mind when doing it, we haven't tested it thoroughly. However,
- we are willing to try and answer any questions you send our way.
-
- EEV10.ZIP
- =========
-
- Expression Evaluator Toolkit V1.00 Revision 0
-
- These files provide you with a complete API for 2 mathematical
- expression evaluators. One is written to evaluate infix (algebraic)
- expressions. The other is written to evaluate postfix (RPN)
- expressions.
-
- INFIX.PAS is based upon a program called CALC.PAS by James L. Dean of
- New Orleans, LA. His program, dated 1985, provided the complete
- recursive descent infix expression evaluator. CALC.PAS was downloaded
- from CIS and had no copyright notice of any kind. Because of the lack
- of any copyright, I assume that I can write a derivitive work. I added
- the variables support and organized the code for use with TP5 or higher.
- His name, address, and original comments (very few) have been competely
- preserved in the source and my documentation file.
-
- ------------------------------------------------------------------
- INFIX.PAS
-
- Note: We at abc Systems had to rename all the "result" vars in the
- INFIX.PAS program to get it to compile under Delphi as RESULT is
- a key word in Delphi. However, we didn't have to do anything else.
- ------------------------------------------------------------------
-
- This unit uses recursive descent to evaluate expressions
- written in infix notation. The operations addition (+),
- subtraction (-), multiplication (*), and division (/) are supported,
- as are the functions ABS, ARCTAN, COS, EXP, LN, SQR, and SQRT.
- PI returns the value for pi. Results exceeding 1.0E37 are reported
- as overflows. Results less than 1.0E-37 are set to zero.
-
- Written by:
-
- James L. Dean
- 406 40th Street
- New Orleans, LA 70124
- February 25, 1985
-
- Modified by:
-
- David J. Firth
- 5665-A2 Parkville St.
- Columbus, OH 43229
- December 26, 1991
-
- This code was originally written as a stand-alone program using
- standard Pascal. In that form the program wasn't very useful.
- I have taken the code and reorganized it for use with Turbo Pascal
- versions 5.x or 6.0. I have added six procedures to this code
- for use as an API (application program interface). Those six
- routines are described in this file.
-
- In addition, I have reworked it to support variables by adding a
- preprocessor. The variables are preceded and followed by a @ symbol,
- are case sensitive, and must be less than 20 characters long
- (including the 2 @s). For example, the following would all be valid
- variables: